﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UriUtility
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void button1_Click(object sender, EventArgs e)
		{
			try
			{
				Uri url = new Uri(textBox1.Text);
				propertyGrid1.SelectedObject = url;
			}
			catch (Exception ex)
			{
				MessageBox.Show(
					ex.Message,
					"Error",
					MessageBoxButtons.OK,
					MessageBoxIcon.Error);
				propertyGrid1.SelectedObject = ex;
			}

			textBox1.Focus();
			textBox1.SelectAll();
		}
	}
}
